<nav:Page xmlns:xom="clr-namespace:Xomega.Framework;assembly=Xomega.Framework"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:nav="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
          Title="Employee Search"
          x:Class="AdventureWorks.Client.Silverlight.EmployeeSearch">
   <Grid Margin="10">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="*"/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid Name="pnlCriteria">
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
         </Grid.ColumnDefinitions>
         <TextBlock Grid.Row="0" Grid.Column="0" Name="lblFirstName" Text="First Name:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="0" Grid.Column="1"
                   xom:Property.Label="{Binding ElementName=lblFirstName}"
                   Name="ctlFirstNameOperator"
                   xom:Property.Name="FirstNameOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" Name="ctlFirstName"
                  xom:Property.Name="FirstName"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="1" Grid.Column="0" Name="lblLastName" Text="Last Name:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"
                  xom:Property.Label="{Binding ElementName=lblLastName}"
                  Name="ctlLastName"
                  xom:Property.Name="LastName"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="2" Grid.Column="0" Name="lblManagerLastName"
                    Text="Manager Last Name:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3"
                  xom:Property.Label="{Binding ElementName=lblManagerLastName}"
                  Name="ctlManagerLastName"
                  xom:Property.Name="ManagerLastName"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="0" Grid.Column="4" Name="lblHireDate" Text="Hire Date:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="0" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblHireDate}"
                   Name="ctlHireDateOperator"
                   xom:Property.Name="HireDateOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="6" Name="ctlHireDate" xom:Property.Name="HireDate"
                  Style="{StaticResource ControlStyle}"/>
         <TextBox Grid.Row="0" Grid.Column="7" Name="ctlHireDate2" xom:Property.Name="HireDate2"
                  Style="{StaticResource ControlStyle}"/>
         <TextBlock Grid.Row="1" Grid.Column="4" Name="lblState" Text="State:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="1" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblState}"
                   Name="ctlStateOperator"
                   xom:Property.Name="StateOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <ListBox Grid.Row="1" Grid.Column="6" Grid.ColumnSpan="2" Name="ctlState"
                  xom:Property.Name="State"
                  Style="{StaticResource ControlStyle}"
                  MaxHeight="58"/>
         <TextBlock Grid.Row="2" Grid.Column="4" Name="lblZipcode" Text="Zipcode:"
                    Style="{StaticResource LabelStyle}"
                    FontWeight="{Binding Path=(xom:Property.Required), RelativeSource={RelativeSource Self}, Converter={StaticResource Required2FontWeight}}"/>
         <ComboBox Grid.Row="2" Grid.Column="5"
                   xom:Property.Label="{Binding ElementName=lblZipcode}"
                   Name="ctlZipcodeOperator"
                   xom:Property.Name="ZipcodeOperator"
                   Style="{StaticResource OperatorStyle}"/>
         <TextBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" Name="ctlZipcode"
                  xom:Property.Name="Zipcode"
                  Style="{StaticResource ControlStyle}"/>
      </Grid>
      <Button Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,100,10"
              Width="75"
              Name="btnSearch"
              Click="btnSearch_Click"
              Content="Search"/>
      <Button Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,0,10"
              Width="75"
              Name="btnReset"
              Click="btnReset_Click"
              Content="Reset"/>
      <data:DataGrid Grid.Row="2" Name="gridResults" AutoGenerateColumns="False">
         <data:DataGrid.Columns>
            <data:DataGridTemplateColumn Header="Id">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Id"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="First Name">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="FirstName"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Last Name">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="LastName"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Title">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Title"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Hire Date">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="HireDate"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Manager">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Manager"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Salaried">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Salaried"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Current">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Current"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Gender">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Gender"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="State Id">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="StateId"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Street Address">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="StreetAddress" xom:Property.ChildObject="Address"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="City">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="City" xom:Property.ChildObject="Address"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="State">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="State" xom:Property.ChildObject="Address"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Zipcode">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Zipcode" xom:Property.ChildObject="Address"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            <data:DataGridTemplateColumn Header="Country">
               <data:DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <TextBlock xom:Property.Name="Country" xom:Property.ChildObject="Address"/>
                  </DataTemplate>
               </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
         </data:DataGrid.Columns>
      </data:DataGrid>
      <Button Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Top"
              Margin="0,10,0,10"
              Width="75"
              Name="btnNew"
              Content="New..."/>
      <Button Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Top"
              Margin="0,10,0,0"
              Width="75"
              Name="btnDetails"
              Content="Details"/>
   </Grid>
</nav:Page>